import { createStore, applyMiddleware } from 'redux'

import thunk from 'redux-thunk'

import { reducer } from '../redux'

const middleware = [ thunk ]

export default (initialState) => {
  const store = createStore(
    reducer,
    applyMiddleware(...middleware)
  );
  return store
}
